package routers

import (
	"github.com/gofiber/fiber/v2"
	"go_test/handlers"
)

func SetupRoutes(app *fiber.App) {

	// 产品相关路由
	//productRoutes := app.Group("/products")
	//productRoutes.Get("/getAll", handlers.GetAllProducts)
	//productRoutes.Get("/getById/:id", handlers.GetProductByID)
	//productRoutes.Post("/create", handlers.CreateProduct)
	//productRoutes.Put("/update/:id", handlers.UpdateProduct)
	//productRoutes.Delete("/delete/:id", handlers.DeleteProduct)
	SetupLinkRoutes(app)
	SetUpDeviceRoutes(app)
}

func SetupLinkRoutes(app *fiber.App) {
	// 链接相关路由
	linkRoutes := app.Group("/linkRequest")
	linkRoutes.Post("/page", handlers.PageAll)

	linkRoutes.Post("/saveOrUpdate", handlers.SaveOrUpdateLinkReq)

	linkRoutes.Post("/startTask", handlers.StartTaskHandle)
	linkRoutes.Post("/stopTask", handlers.StopTaskHandle)
}

func SetUpDeviceRoutes(app *fiber.App) {
	deviceRoutes := app.Group("/iosDevice")
	deviceRoutes.Post("/page", handlers.PageAllDevice)

}
